package net.colorlotus7;

import static net.colorlotus7.Constants.DEFAULT_PORT;

/**
 * @Description:
 * @Author: Jason.zhu
 * @Create: 2020/02/19 12:10
 */

public class NioServer {
    private static NioServerHandle nioServerHandle;

    public static void start(){
        if(nioServerHandle != null){
            nioServerHandle.stop();
        }
        nioServerHandle = new NioServerHandle(DEFAULT_PORT);
        new Thread(nioServerHandle, "server").start();
    }

    public static void main(String[] args) {
        start();
    }
}
